<?php
class Mageex_RelatedProduct_Block_Block extends Mage_Core_Block_Template
{
	
	protected function _toHtml()
	{
		
		if(!Mage::helper('relatedproduct/config')->isMageexBlocksEnable()) return '';
		
		$position = $this->getBlockPosition(); 
		$controllerName = $this->getRequest()->getControllerName();
		
		//$arrPosition = Mage::helper('relatedproduct')->getBlocks($position, $controllerName, true);
		$arrCondition['type'] = $position;
		$arrCondition['page'] = $controllerName;
		
		return $this->getLayout()->createBlock('relatedproduct/relatedproduct')->setData('condition',$arrCondition)->toHtml();
		
	}
}